<%@ page contentType="text/html;charset=UTF-8" language="java" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link href="<c:url value='/css/default.css'/>" rel="stylesheet" type="text/css"/>
<fmt:setBundle basename="message" />
<title><fmt:message key="label.facility.add"/></title>
</head>
<body>
<%@include file="Header.jsp" %>
<div id="wrapper">	
    <div id="page-wrapper">
		<div id="page">
		<%@include file="Menu.jsp" %>		
			<div id="content">
				<div> 
      <h2><fmt:message key="label.facility"/></h2>
      <c:url var ="url" scope="page" value="/ManageFacility.jsp">
           <c:param name= "name" value= ""/>
           <c:param name= "description" value=""/>
            <c:param name= "type" value=""/>
             <c:param name= "seatingCapacity" value=""/>
             <c:param name= "status" value=""/>
              <c:param name= "insert" value="true"/>
      </c:url>
      <a href="${url}"><fmt:message key="label.facility.add"/></a>
        <br/><br/>
         <table class="table-view">
            <tr>
               <th>#</th>
                <th><fmt:message key="label.facility.name"/></th>
                <th><fmt:message key="label.facility.description"/></th>
                <th><fmt:message key="label.facility.type"/></th>
                   <th><fmt:message key="label.facility.seatingcapacity"/></th>
                      <th><fmt:message key="label.facility.status"/></th>
                <th><fmt:message key="label.edit"/> </th>
                <th><fmt:message key="label.delete"/></th>
            </tr>
            <c:forEach var="facility" items="${facilitys}" varStatus="status">
                <tr class="${status.index%2==0?'even':'odd'}">
                    <td class="id">${status.index + 1}</td>
                    <td class="small">${facility.name}</td>
                    <td >${facility.description}</td>
                    <td >${facility.type}</td>
                    <td >${facility.seatingCapacity}</td>
                    <td >${facility.status==1?'Available':'Unavailable'}</td>
                    
                 
                    <td class="edit">
                        <c:url var="updurl" scope="page" value="/ManageFacility.jsp">
                            <c:param name="name" value="${facility.name}"/>
                            <c:param name="description" value="${facility.description}"/>
                            <c:param name="type" value="${facility.type}"/>
                            <c:param name="seatingCapacity" value="${facility.seatingCapacity}"/>
                            <c:param name="status" value="${facility.status}"/>
                             <c:param name="update" value="true"/>
                        </c:url>
                        <a href="${updurl}"><fmt:message key="label.edit"/></a>
                        </td>                        
                        <td class="delete">
                        <c:url var="delurl" scope="page" value="/DeleteFacility">
                            <c:param name="name" value="${facility.name}"/>
                        </c:url>
                        <a href="${delurl}"><fmt:message key="label.delete"/></a>
                    </td>
                </tr>
            </c:forEach>
            </table>
             </div>
			</div>
       </div>
	</div>
</div>
	<%@include file="Footer.jsp" %>      
       
</body>
</html>